/ Assembly List / LJCNetCommon / NetCommon / GetChar

Namespace - LJCNetCommon


Parameters
value - The value object.

Returns

The char value or the char default if the object is null. Also returns false if the object is not type "char".

Syntax

C#
public static Char GetChar(Object value)

Gets a byte value from an object.

Example

C#
using LJCNetCommon;

// Gets a char value from an object.
private static void GetChar()
{
    // Simulates an Object value like that received from a DataTable.
    char setup = Convert.ToChar('A');
    object obj = setup;

    // Gets a byte value from an object.
    char value = NetCommon.GetChar(obj);
    var result = value.ToString();
    var compare = "A";
    TestCommon?.Write("GetChar()", result, compare);
}

Copyright © Lester J. Clark and Contributors.
Licensed under the MIT License.